// LoginServer Game.h

#ifndef GAME_H

#include "../Frame/TcpServer.h"
#include "../Frame/TcpClient.h"
#include "../Frame/Config.h"
#include "../Frame/Common.h"
#include "../Frame/Database.h"
#include "../Frame/Debug.h"
#include "../Frame/AccountManager.h"
#include "../Frame/GlobalManager.h"
#include "MsgRounter.h"
#include "System/Login.h"

#include <iostream>
#include <thread>
#include <fstream>

#define GAME_H


class Game
{
private:
	Game();
	Game(const Game& _Game);
    TcpServer m_ServerSock;



    bool m_isEixt;

	//std::list<Player> m_Player_lst; 				// Player list

public:

	~Game();

	static Game& GetInstance()
	{
		static Game Instance;
		return Instance;
	}

	void Init();

	void Dispose();

	void Exit();

	void GameLoop();

	void SendMsg2Client(Message* _pMsg);

	TcpServer* GetSock();

	Database  m_GameDb; 									// 数据库

	MsgRounter m_MsgRounter; 								// 消息路由

	Login m_Login; 											// 登陆系统

	GlobalManager m_GlobalMgr; 								// 全局数据管理器

	AccountManager m_AccountMgr; 							// 帐号管理器


protected:


};

#endif // GAME_H
